<template>
  <div class="wechat">
    <!-- 卡片视图区域 -->
    <div class="wechat_card">
      <!-- 布局 -->
      <el-row :gutter="20" class="wechat_card_head" type="flex">
        <el-col :span="6">
          <!-- 搜索框及添加区域 -->
          <el-input placeholder="请输入家庭成员名" v-model="queryInfo.query" clearable @clear="getFamilyList" size="medium">
            <el-button slot="append" size="medium" icon="el-icon-search" @click="getFamilyList"></el-button>
          </el-input>
        </el-col>
        <el-button size="medium" class="btn_head_medium" type="primary" @click="addDialogVisible = true" icon="el-icon-circle-plus-outline">新增</el-button>

        <el-button size="medium" type="danger" @click="removeUserByIds" icon="el-icon-remove-outline">删除</el-button>
        <!-- 婚姻状况筛选 -->
        <el-select class="select_head_medium" size="medium" v-model="marryInfoValue" @change="selectChange" clearable collapse-tags placeholder="按婚姻状况筛选">
          <el-option label="未婚" value="未婚"></el-option>
          <el-option label="已婚" value="已婚"></el-option>
          <el-option label="离婚" value="离婚"></el-option>
          <el-option label="丧偶" value="丧偶"></el-option>
        </el-select>
        <!-- 文化程度筛选 -->
        <el-select class="select_head_medium" size="medium" v-model="eduInfoValue" @change="selectChange" clearable collapse-tags multiple placeholder="按文化程度筛选">
          <el-option label="博士" value="博士"></el-option>
          <el-option label="研究生" value="研究生"></el-option>
          <el-option label="本科" value="本科"></el-option>
          <el-option label="大专或中专" value="大专或中专"></el-option>
          <el-option label="高中" value="高中"></el-option>
          <el-option label="初中" value="初中"></el-option>
          <el-option label="小学" value="小学"></el-option>
          <el-option label="文盲" value="文盲"></el-option>
        </el-select>
        <!-- 兵役状况筛选 -->
        <el-select class="select_head_medium" size="medium" v-model="serviceValue" @change="selectChange" clearable collapse-tags placeholder="按兵役状况筛选">
          <el-option label="未服役" value="0"></el-option>
          <el-option label="服役" value="1"></el-option>
        </el-select>
        <!-- 表格列筛选 -->
        <div class="tools_head">
          <el-popover placement="bottom" trigger="click">
            <el-checkbox-group v-model="colOptions">
              <el-checkbox v-for="item in colSelect" :label="item" :key="item" style="display: block; margin: 10px">
              </el-checkbox>
            </el-checkbox-group>
            <div slot="reference">
              <el-tooltip content="筛选列" placement="bottom">
                <el-button size="small" icon="el-icon-menu"></el-button>
              </el-tooltip>
            </div>
            <el-button size="small" type="text" @click="filterFunHandle('allchecked')">全选</el-button>
            <el-button size="small" type="text" @click="filterFunHandle('cancel')">取消全选</el-button>
          </el-popover>
          <el-tooltip content="导出excel" placement="bottom">
            <el-button size="small" icon="el-icon-download" style="margin-left: 10px" @click="handleDownload"></el-button>
          </el-tooltip>
        </div>
      </el-row>
      <!-- 家庭成员列表区域 -->
      <el-table :data="familyList" style="width: 100%" border stripe :header-cell-style="{ textAlign: 'center' }" :cell-style="{ textAlign: 'center' }" :row-key="
          (row) => {
            return row.id;
          }
        " height="85%" size="small" @selection-change="handleSelectionChange" ref="tableDataRef">
        <el-table-column type="selection" :reserve-selection="true"></el-table-column>
        <el-table-column type="index" v-if="colData[0].istrue" label="序号"></el-table-column>
        <el-table-column prop="name" v-if="colData[1].istrue" label="姓名">
        </el-table-column>
        <el-table-column prop="gender" v-if="colData[2].istrue" label="性别">
        </el-table-column>
        <el-table-column prop="phone" v-if="colData[3].istrue" label="联系电话" width="130px">
        </el-table-column>
        <el-table-column prop="roomNo" v-if="colData[4].istrue" label="房间号"></el-table-column>
        <el-table-column prop="floorName" v-if="colData[5].istrue" label="楼栋号"></el-table-column>
        <el-table-column prop="floorUnitName" v-if="colData[6].istrue" label="单元号"></el-table-column>
        <el-table-column prop="jobInfo" v-if="colData[7].istrue" label="职业" show-overflow-tooltip></el-table-column>
        <el-table-column prop="marryInfo" v-if="colData[8].istrue" label="婚姻状况"></el-table-column>
        <el-table-column prop="nativePlace" v-if="colData[9].istrue" label="籍贯"></el-table-column>
        <el-table-column prop="relationShip" v-if="colData[10].istrue" label="与业主关系" width="100px"></el-table-column>
        <el-table-column prop="eduInfo" v-if="colData[11].istrue" label="文化程度" show-overflow-tooltip></el-table-column>
        <el-table-column prop="militaryState" v-if="colData[12].istrue" label="兵役状况" width="100px" column-key="militaryState" :filters="[
            { text: '未服役', value: 0 },
            { text: '服役', value: 1 },
          ]" :filter-method="filterTag" filter-placement="bottom-end">
          <template slot-scope="scope">
            <el-tag v-if="scope.row.militaryState === 0" type="success">未服役</el-tag>
            <el-tag v-else type="danger">服役</el-tag>
          </template>
        </el-table-column>
        <el-table-column prop="userType" v-if="colData[13].istrue" label="客户类型" width="100px">
          <template slot-scope="scope">
            <el-tag v-if="scope.row.userType === 0" type="success">业主</el-tag>
            <el-tag v-else-if="scope.row.userType === 1" type="danger">家庭成员</el-tag>
            <el-tag v-else type="warning">入住人员</el-tag>
          </template>
        </el-table-column>
        <el-table-column prop="nation" v-if="colData[14].istrue" label="民族"></el-table-column>
        <el-table-column prop="idCard" v-if="colData[15].istrue" label="身份证号" width="180px">
        </el-table-column>
        <el-table-column prop="religious" v-if="colData[16].istrue" label="宗教信仰"></el-table-column>
        <el-table-column prop="addUserId" v-if="colData[17].istrue" label="添加人"></el-table-column>
        <el-table-column prop="addTime" v-if="colData[18].istrue" label="添加时间" width="180px">
        </el-table-column>
        <el-table-column label="操作" width="150px" fixed="right">
          <!-- 作用域插槽 -->
          <template slot-scope="scope">
            <!-- 修改按钮 -->
            <el-button type="primary" icon="el-icon-edit" size="mini" @click="showEditDialog(scope.row.id)"></el-button>
            <!-- 删除按钮 -->
            <el-button type="danger" icon="el-icon-delete" size="mini" @click="removeUserById(scope.row.id)"></el-button>
          </template>
        </el-table-column>
      </el-table>
      <!-- 添加家庭成员的对话框 -->
      <el-dialog title="添加家庭成员" :visible.sync="addDialogVisible" width="50%" @close="addDialogReset">
        <!-- 内容主题区域 -->
        <el-form :model="addForm" :rules="addFormRules" ref="addFormRef" label-width="100px" :inline="true">
          <el-form-item label="姓名" prop="name">
            <el-input v-model="addForm.name"></el-input>
          </el-form-item>
          <el-form-item label="性别" prop="gender">
            <el-input v-model="addForm.gender"></el-input>
          </el-form-item>
          <el-form-item label="联系电话" prop="phone">
            <el-input v-model="addForm.phone" onkeyup="this.value=this.value.replace(/[^\X0-9]/g, '')"></el-input>
          </el-form-item>
          <el-form-item label="身份证号" prop="idCard">
            <el-input v-model="addForm.idCard"></el-input>
          </el-form-item>
          <el-form-item label="房间id" prop="roomId">
            <el-input v-model="addForm.roomId" placeholder="请输入房间id"></el-input>
          </el-form-item>
          <el-form-item label="职业" prop="jobInfo">
            <el-input v-model="addForm.jobInfo"></el-input>
          </el-form-item>
          <el-form-item label="婚姻状况" prop="marryInfo">
            <el-select v-model="addForm.marryInfo" placeholder="请选择婚姻状况" class="select">
              <el-option label="未婚" value="未婚"></el-option>
              <el-option label="已婚" value="已婚"></el-option>
              <el-option label="离婚" value="离婚"></el-option>
              <el-option label="丧偶" value="丧偶"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="籍贯" prop="nativePlace">
            <el-input v-model="addForm.nativePlace"></el-input>
          </el-form-item>
          <el-form-item label="与业主关系" prop="relationShip">
            <el-input v-model="addForm.relationShip"></el-input>
          </el-form-item>
          <el-form-item label="民族" prop="nation">
            <el-input v-model="addForm.nation"></el-input>
          </el-form-item>
          <el-form-item label="文化程度" prop="eduInfo">
            <el-select v-model="addForm.eduInfo" placeholder="请选择文化程度" class="select">
              <el-option label="博士" value="博士"></el-option>
              <el-option label="研究生" value="研究生"></el-option>
              <el-option label="本科" value="本科"></el-option>
              <el-option label="大专或中专" value="大专或中专"></el-option>
              <el-option label="高中" value="高中"></el-option>
              <el-option label="初中" value="初中"></el-option>
              <el-option label="小学" value="小学"></el-option>
              <el-option label="文盲" value="文盲"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="兵役状况" prop="militaryState">
            <el-radio-group v-model="addForm.militaryState">
              <el-radio :label="0">未服役</el-radio>
              <el-radio :label="1">服役</el-radio>
            </el-radio-group>
          </el-form-item>
          <el-form-item label="宗教信仰" prop="religious">
            <el-input v-model="addForm.religious"></el-input>
          </el-form-item>
        </el-form>
        <!-- 底部区域 -->
        <span slot="footer" class="dialog-footer">
          <el-button @click="addDialogVisible = false">取 消</el-button>
          <el-button type="primary" @click="addFamilyInfo">确 定</el-button>
        </span>
      </el-dialog>
      <!-- 修改家庭成员信息的对话框 -->
      <el-dialog title="修改家庭成员信息" :visible.sync="editDialogVisible" width="50%" @close="editDialogClosed">
        <el-form ref="editFormRef" :model="editForm" label-width="100px" :rules="editFormules" :inline="true">
          <el-form-item label="姓名">
            <el-input v-model="editForm.name" disabled></el-input>
          </el-form-item>
          <el-form-item label="联系电话" prop="phone">
            <el-input v-model="editForm.phone"></el-input>
          </el-form-item>
          <el-form-item label="房间id" prop="roomId">
            <el-input v-model="editForm.roomId" placeholder="请输入房间id"></el-input>
          </el-form-item>
          <el-form-item label="婚姻状况" prop="marryInfo">
            <el-select v-model="editForm.marryInfo" placeholder="请选择婚姻状况" class="select">
              <el-option label="未婚" value="未婚"></el-option>
              <el-option label="已婚" value="已婚"></el-option>
              <el-option label="离婚" value="离婚"></el-option>
              <el-option label="丧偶" value="丧偶"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="籍贯" prop="nativePlace">
            <el-input v-model="editForm.nativePlace"></el-input>
          </el-form-item>
          <el-form-item label="文化程度" prop="eduInfo">
            <el-select v-model="editForm.eduInfo" placeholder="请选择文化程度" class="select">
              <el-option label="博士" value="博士"></el-option>
              <el-option label="研究生" value="研究生"></el-option>
              <el-option label="本科" value="本科"></el-option>
              <el-option label="大专或中专" value="大专或中专"></el-option>
              <el-option label="高中" value="高中"></el-option>
              <el-option label="初中" value="初中"></el-option>
              <el-option label="小学" value="小学"></el-option>
              <el-option label="文盲" value="文盲"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="兵役状况" prop="militaryState">
            <el-radio-group v-model="editForm.militaryState">
              <el-radio :label="0">未服役</el-radio>
              <el-radio :label="1">服役</el-radio>
            </el-radio-group>
          </el-form-item>
          <el-form-item label="宗教信仰" prop="religious">
            <el-input v-model="editForm.religious"></el-input>
          </el-form-item>
        </el-form>
        <!-- 底部区域 -->
        <span slot="footer" class="dialog-footer">
          <el-button @click="editDialogVisible = false">取 消</el-button>
          <el-button type="primary" @click="editFamilyInfo">确 定</el-button>
        </span>
      </el-dialog>
      <!-- 分页区域 -->
      <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="this.queryInfo.pageNum" :page-sizes="[3, 5, 10, 15]" :page-size="this.queryInfo.pageSize" layout="total, sizes, prev, pager, next, jumper" :total="total">
      </el-pagination>
    </div>
  </div>
</template>
<script>
import { isIdentityId } from '../../../utils/validate'
import axios from 'axios'
export default {
  data() {
    // 验证手机号
    var checkMobile = (rule, value, callback) => {
      // 验证邮箱的正则表达式
      const regMobile = /^(0|86|17951)?(13[0-9]|15[012356789]|17[678]|18[0-9]|19[0-9]|14[57])[0-9]{8}$/
      if (regMobile.test(value)) {
        // 合法的手机
        return callback()
      }
      callback(new Error('请输入合法的手机'))
    }
    //验证身份证号
    var checkIdentitytionId = (rule, value, callback) => {
      var errorMsg = isIdentityId(value);
      if (errorMsg != "") {
        callback(new Error(errorMsg));
      } else {
        callback()
      }
    }
    return {
      // 获取家庭成员列表的参数对象
      queryInfo: {
        query: '',
        pageNum: 1,
        pageSize: 5
      },
      familyList: [],
      colData: [
        { title: "序号", istrue: true },
        { title: "姓名", istrue: true },
        { title: "性别", istrue: true },
        { title: "联系电话", istrue: true },
        { title: "房间号", istrue: true },
        { title: "楼栋号", istrue: true },
        { title: "单元号", istrue: true },
        { title: "职业", istrue: true },
        { title: "婚姻状况", istrue: true },
        { title: "籍贯", istrue: true },
        { title: "与业主关系", istrue: true },
        { title: "文化程度", istrue: true },
        { title: "兵役状况", istrue: true },
        { title: "客户类型", istrue: true },
        { title: "民族", istrue: true },
        { title: "身份证号", istrue: true },
        { title: "宗教信仰", istrue: true },
        { title: "添加人", istrue: true },
        { title: "添加时间", istrue: true },
      ],
      colOptions: [],//多选框默认全选
      colSelect: [],//所有表头标题,跟多选框组绑定的
      total: 0,
      //选中行的id数组
      multipleSelection: [],
      idsArray: {
        ids: []
      },
      // 控制添加对话框的显示与隐藏
      addDialogVisible: false,
      // 控制修改对话框的显示与隐藏
      editDialogVisible: false,
      marryInfoValue: '',//筛选下拉框单选：婚姻状况
      eduInfoValue: [],//筛选下拉框多选：文化程度
      serviceValue: '',//筛选下拉框单选：兵役状况
      // 添加房产的表单数据
      addForm: {
        name: '',
        gender: '',
        phone: '',
        idCard: '',
        userType: '',
        roomId: '',
        jobInfo: '',
        marryInfo: '',
        nativePlace: '',
        relationShip: '',
        nation: '',
        eduInfo: '',
        militaryState: '',
        religious: '',
        addUserId: '',
        addTime: ''
      },
      // 查询到的编辑家庭成员信息
      editForm: {},
      // 添加表单的验证规则对象
      addFormRules: {
        name: [{ required: true, message: '请输入姓名', trigger: 'blur' }],
        gender: [{ required: true, message: '请输入性别', trigger: 'blur' }],
        phone: [
          { required: true, message: '请输入联系电话', trigger: 'blur' },
          { validator: checkMobile, trigger: 'blur' }
        ],
        idCard: [
          { required: true, message: '请输入身份证号', trigger: 'blur' },
          { validator: checkIdentitytionId, trigger: "blur" }
        ],
        roomId: [{ required: true, message: '请输入房间id', trigger: 'blur' }],
        jobInfo: [{ required: true, message: '请输入职业', trigger: 'blur' }],
        nativePlace: [{ required: true, message: '请输入籍贯', trigger: 'blur' }],
        nation: [{ required: true, message: '请输入民族', trigger: 'blur' }],
        relationShip: [{ required: true, message: '请输入关系', trigger: 'blur' }]
      },
      // 修改家庭成员信息表单的验证规则
      editFormules: {
        name: [{ required: true, message: '请输入姓名', trigger: 'blur' }],
        phone: [{ required: true, message: '请输入联系电话', trigger: 'blur' }],
        roomId: [{ required: true, message: '请输入房间id', trigger: 'blur' }],
        jobInfo: [{ required: true, message: '请输入职业', trigger: 'blur' }],
        nativePlace: [{ required: true, message: '请输入籍贯', trigger: 'blur' }],

      }

    }

  },
  created() {
    this.getFamilyList()
    var _this = this;
    for (let i = 0; i < _this.colData.length; i++) {
      _this.colSelect.push(_this.colData[i].title);
      if (_this.colData[i].title == '添加人' || _this.colData[i].title == '添加时间' || _this.colData[i].title == '身份证号' || _this.colData[i].title == '民族' || _this.colData[i].title == '客户类型') { //初始化不想展示的列可以放在这个条里
        continue;
      }
      _this.colOptions.push(_this.colData[i].title);
    }
  },
  watch: {
    // 单选列实现
    colOptions(valArr) {
      var arr = this.colSelect.filter(i => valArr.indexOf(i) < 0); // 未选中
      this.colData.filter(i => {
        if (arr.indexOf(i.title) != -1) {
          i.istrue = false;
        } else {
          i.istrue = true;
        }
      });
      this.$nextTick(() => {
        this.$refs.tableDataRef.doLayout();
      });
    }
  },
  methods: {
    // 获取家庭成员档案列表
    async getFamilyList() {
      this.queryInfo = this.getQueryCondition()
      const { data: res } = await this.$http.get('BaseresidentinfoAction/getBasicInfos', { params: this.queryInfo })
      if (!res.success) return this.$message.error('获取家庭成员列表失败')
      console.log(res)
      this.familyList = res.rows
      this.total = res.total
    },

    //点击按钮，添加家庭成员
    addFamilyInfo() {
      this.$refs.addFormRef.validate(async valid => {
        if (!valid) return
        //给隐藏的input输入框中的添加人addUserId赋值
        this.addForm.addUserId = window.sessionStorage.getItem('userId')
        // 添加时间
        this.addForm.addTime = this.dateFormat()
        //console.log(this.addForm.addTime)
        this.addForm.userType = 1
        const { data: res } = await this.$http.post("BaseresidentinfoAction/addObject", this.addForm)
        if (!res.success) return this.$message.error('添加家庭成员失败')
        //关闭对话框
        this.addDialogVisible = false
        //刷新数据列表
        this.getFamilyList()
        this.$message.success('添加家庭成员成功')
      })
    },

    filterTag(value, row) {
      return row.militaryState === value;
    },
    // 展示编辑家庭成员的对话框
    async showEditDialog(id) {
      const { data: res } = await this.$http.post("BaseresidentinfoAction/getObjectById", { id })
      if (!res.success)
        return this.$message.error('查询家庭成员失败')
      this.editForm = res.rows[0]
      // console.log(this.editForm);
      this.editDialogVisible = !this.editDialogVisible
    },
    //点击按钮，修改家庭成员信息
    editFamilyInfo() {
      this.$refs.editFormRef.validate(async valid => {
        if (!valid) return
        const { data: res } = await this.$http.post("BaseresidentinfoAction/updateNoNull", this.editForm)
        if (!res.success) return this.$message.error('修改家庭人员信息失败')
        //关闭对话框
        this.editDialogVisible = false
        //刷新数据列表
        this.getFamilyList()
        this.$message.success('修改家庭成员信息成功')
      })
    },
    // 根据id删除家庭成员
    async removeUserById(ids) {
      // 先弹框询问用户是否确定要删除
      const confirmResult = await this.$confirm('此操作将永久删除该家庭成员, 是否继续?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).catch(err => {
        return err
      })
      // 如果点击取消返回的是字符串cancel
      // 如果点击确认返回的是字符串confirm
      if (confirmResult !== 'confirm') {
        return this.$message.info('取消了删除')
      }
      const { data: res } = await this.$http.post("BaseresidentinfoAction/deleteByIds", { ids })
      console.log(res);
      if (!res.success) {
        return this.$message.error('删除家庭成员失败')
      }
      this.$message.error('删除家庭成员成功')
      // 刷新列表
      this.getFamilyList()
    },

    //批量删除
    async removeUserByIds() {
      const rows = this.$refs.tableDataRef.selection;
      if (rows.length === 0) {
        this.$message.warning('请选择需要操作的数据')
        return
      }
      else {
        // 先弹框询问用户是否确定要删除
        const confirmResult = await this.$confirm('此操作将永久删除该家庭成员, 是否继续?', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).catch(err => {
          return err
        })
        if (confirmResult !== 'confirm') {
          return this.$message.info('取消了删除')
        }
        const { data: res } = await this.$http.post("BaseresidentinfoAction/deleteByIds", this.idsArray)
        console.log(res);
        if (!res.success) {
          return this.$message.error('删除家庭成员失败')
        }
        this.$message.success('删除家庭成员成功')
        //此时全选框还是选中状态，批量删除后需清除选中状态
        this.$refs.tableDataRef.clearSelection();
        // 刷新列表
        this.getFamilyList()
      }

    },
    //当多选框选择项发生变化时会触发该事件
    handleSelectionChange(val) {
      this.multipleSelection = val;
      this.idsArray.ids = [] //每次点击需清空原本数组的内容
      this.multipleSelection.map(item => { //遍历数组，把id存进自定义的数组里
        this.idsArray.ids.push(item.id)
      })
      this.idsArray.ids = this.idsArray.ids.join(',')
      // console.log(this.idsArray);

    },
    //导出Excel表
    handleDownload() {
      window.open(axios.defaults.baseURL + '/BaseresidentinfoAction/exportDataToExcel?token=' + window.sessionStorage.getItem('token'))
    },
    // 监听修改家庭成员对话框的关闭事件
    editDialogClosed() {
      this.$refs.editFormRef.resetFields()
    },
    // 监听pageSize改变的事件
    handleSizeChange(newPageSize) {
      // console.log(newPageSize)
      this.queryInfo.pageSize = newPageSize
      // PageSize改变重新拿到家庭成员列表
      this.getFamilyList()
    },
    // 监听当前页码改变的事件
    handleCurrentChange(newPageNum) {
      // console.log(newPageNum)
      this.queryInfo.pageNum = newPageNum
      this.getFamilyList()
    },
    addDialogReset() {
      // 拿到表单的引用进行重置
      this.$refs.addFormRef.resetFields()
    },
    // 全选或取消全选实现
    filterFunHandle(type, currentItem, index) {
      if (type === 'allchecked') { // 全选
        if (this.colSelect.length === 0) {
          this.colData.forEach((result) => {
            this.colSelect.push(result.title)
          })
          this.colOptions = this.colSelect // 复选框置为复选所有值，全部选择

        } else {
          this.colOptions = this.colSelect // 复选框置为复选所有值，全部选择

        }
      } else if (type === 'cancel') { // 取消全选
        this.colOptions = [] // 复选框置为空，全部不选择

      }
    },
    //工具栏的各种下拉框筛选监听
    async selectChange() {
      this.getFamilyList()
    },
    //获取工具栏的各类查询条件：搜索框关键词、筛选框值等
    getQueryCondition() {
      //搜索框筛选
      var search = `and baseresidentinfo.name like "%${this.queryInfo.query}%"`;

      // 下拉框筛选
      var edulist = '';
      if (this.eduInfoValue.length != 0) {
        edulist += ` and(`;
        for (var i in this.eduInfoValue) {
          edulist += ` baseresidentinfo.eduInfo='${this.eduInfoValue[i]}'`
          if (i != this.eduInfoValue.length - 1) {
            edulist += ` or `
          }
        }
        edulist += `)`
      }
      var marryInfo = '';
      if (this.marryInfoValue !== '') {
        marryInfo += ` and baseresidentinfo.marryInfo='${this.marryInfoValue}'`;
      }
      var service = '';
      if (this.serviceValue !== '') {
        service += ` and baseresidentinfo.militaryState='${this.serviceValue}'`;
      }
      this.queryInfo.condition = ` userType=1 ` + `${search}${marryInfo}${edulist}${service}`;
      return this.queryInfo;
    }
  }
}
</script>
<style lang="less" scoped>
.el-radio-group {
  width: 202px;
}
</style>